import { _decorator, Component,  } from 'cc';
import { GameState } from './config/game-state';
const { ccclass, property } = _decorator;

@ccclass('GameCtrl')
export class GameCtrl extends Component {
    private static _instance: GameCtrl

    public static get instance(): GameCtrl {
        if (!this._instance) this._instance = new GameCtrl()
        return this._instance
    }

    @property moveSpeed: number = 100
    @property pipeRate: number = 5

    currentGS: GameState = GameState.Ready

    readyState() {
        this.currentGS = GameState.Ready
    }

    playState() {
        this.currentGS = GameState.Play
    }

    overState() {
        this.currentGS = GameState.Over
    }
}


